import { createWebHashHistory, createRouter } from 'vue-router';

const routes = [
    {
        path: '/',
        name:'layout',
        component: () => import('@/layout/index.vue'), // 假设这是所有页面的通用布局
        children: [
            {
                path: '',
                name: 'home',
                component: () => import('@/views/home/index.vue'),
            },
            {
                path: 'details',
                name: 'details',
                component: () => import('@/views/details/index.vue'),
            },
            {
                path: 'list',
                name: 'list',
                component: () => import('@/views/list/index.vue'),
            },
            {
                path: 'videoList',
                name: 'videoList',
                component: () => import('@/views/list/video.vue'),
            },
            {
                path: 'videoDetails',
                name: 'videoDetails',
                component: () => import('@/views/details/video.vue'),
            },
            {
                path: 'tgxz',
                name: 'tgxzDetails',
                component: () => import('@/views/details/tgxz.vue'),
            },
            {
                path: 'teamList',
                name: 'teamList',
                component: () => import('@/views/list/team.vue'),
            },
            {
                path: 'teamDetails',
                name: 'teamDetails',
                component: () => import('@/views/teamDetails/index.vue'),
            },
            {
                path: 'expertsList',
                name: 'expertsList',
                component: () => import('@/views/list/experts.vue'),
            },
            {
                path: 'skillList',
                name: 'skillList',
                component: () => import('@/views/list/skill.vue'),
            },
            {
                path: 'industry',
                name: 'industry',
                component: () => import('@/views/list/industry.vue'),
            },
            // 其他子路由...
        ]
    }
];


const router = createRouter({
    history: createWebHashHistory(),
    routes,
    scrollBehavior (to, from, savedPosition) {
        // return 期望滚动到哪个的位置
        return {
            top:0
        }
    }
});

export default router;
